#include <stdio.h>

int sub(int x1, int x2, int x3) { return x1 - x2 - x3; }

int acc(int r) {
  for (int i = 0; i <= 5; i++) {
    r = r + i;
  }
  return r;
}

int main() {
  int a, b, c, d;
  printf("a b c d = ");
  scanf("%d%d%d%d", &a, &b, &c, &d);

  int x = b + a;
  int y = c - d;

  int z;

  if (x == y)
    z = sub(a, b, c);
  else
    z = acc(a);

  printf("x=%d, y=%d, z=%d\n", x, y, z);

  return 0;
}
